package me.shiqiang.im.action;

import com.tst.common.returnobj.ReturnObj;
import com.tst.common.returnobj.ReturnObjCode;
import me.shiqiang.im.service.SensitiveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author cuishiqiang
 * @date 2018/6/22 下午3:22
 */
@RestController
@RequestMapping("im/sensitive")
public class SensitiveAction {

    @Autowired
    SensitiveService service;

    @GetMapping("version")
    public ReturnObj<String> getVersion() {
        String version = service.getVersion();
        return new ReturnObj<>(ReturnObjCode.SUCCESS,version);
    }

    @PutMapping("version")
    public void updateVersion() {
        service.updateVersion();
    }
}
